﻿Imports System.Data
Imports System.Data.SqlClient
Public Class Frm_Agenda
    Dim index As String = ""
    Dim loade As Boolean = True
    Dim T(0, 0) As String
    Dim ligne As Integer = 0

    Public Sub clicke(ByVal text As String)
        Dim moi As String = Combo_mois.Text
        If text.Length = 1 Then
            text = "0" & text
        End If
        If Combo_mois.Text.Length = 1 Then
            moi = "0" & moi
        End If
        Dim dat As String = Combo_annee.Text & "-" & moi & "-" & text
        liste = "demande"
        StandardInitial()
        Frm_liste_Demande.MdiParent = Frm_Main
        Frm_liste_Demande.Show()
        '-----------------------------------------
        With Frm_liste_Demande
            .comb_selectionnez.Text = "Date D'evenement"
            .txt_rech.Text = dat
        End With
    End Sub

    Public Sub levents()
        Dim c As Integer = 0
        T = Nothing
        ligne = 0
        If Con.State = ConnectionState.Open Then
            cnClose()
        End If
        Try
            Cmd = New SqlCommand("select count(Date_evenement) from clients_Demande" & _
                                " where datepart(month,Date_evenement)=" & Combo_mois.Text & _
                                " and datepart(year,Date_evenement)=" & Combo_annee.Text, Con)
            open()
            c = Cmd.ExecuteScalar
            cnClose()
            '---------------------------------------------------------------------------------
            ReDim Preserve T(c - 1, 1)
            Cmd = New SqlCommand("select Date_evenement,lieu from clients_Demande" & _
                                 " where datepart(month,Date_evenement)=" & Combo_mois.Text & _
                                 " and datepart(year,Date_evenement)=" & Combo_annee.Text & _
                                 " and Annuler='false'" & _
                                 " group by Date_evenement,lieu" & _
                                 " order by Date_evenement", Con)
            open()
            Dr = Cmd.ExecuteReader()
            If Dr.HasRows Then
                Do While Dr.Read()
                    T(ligne, 0) = Dr("Date_evenement")
                    T(ligne, 1) = Dr("lieu")
                    ligne += 1
                Loop
            End If
            Dr.Close()
            cnClose()
        Catch ex As Exception
            MsgBox(ex.Message, MsgBoxStyle.Exclamation)
            cnClose()
        End Try
    End Sub
    Public Sub colorer()
        Dim i As Integer = 0
        Dim cont As Integer = 0
        Dim temp As Date
        Dim bool As Boolean = False
        If ligne > 0 Then
            temp = CDate(T(0, 0))
        End If

        For i = 0 To ligne - 1
            bool = False
            If temp = CDate(T(i, 0)) Then
                If T(i, 1) = "Salle 1" Then
                    cont += 2
                ElseIf T(i, 1) = "Salle 2" Then
                    cont += 3
                ElseIf T(i, 1) = "Autre Salle" Then
                    cont += 7
                ElseIf T(i, 1) = "Domicile" Then
                    cont += 11
                End If
            End If
            '---------------------------------------------
            If i < ligne - 1 Then
                If temp <> CDate(T(i + 1, 0)) Then
                    bool = True
                End If
            End If
            If i = ligne - 1 Or bool Then

                If cont = 2 Then
                    For Each btn As Control In Me.GroupBox2.Controls
                        If TypeOf btn Is Button And btn.Text <> "" Then
                            If CDate(btn.Text & "/" & Combo_mois.Text & "/" & Combo_annee.Text) = CDate(T(i, 0)) Then
                                btn.BackColor = Color.Gold
                                btn.ForeColor = Color.Black
                            End If
                        End If
                    Next
                    '-------------------------------------------------------------------------------------
                ElseIf cont = 3 Then
                    For Each btn As Control In Me.GroupBox2.Controls
                        If TypeOf btn Is Button And btn.Text <> "" Then
                            If CDate(btn.Text & "/" & Combo_mois.Text & "/" & Combo_annee.Text) = CDate(T(i, 0)) Then
                                btn.BackColor = Color.DarkGreen
                            End If
                        End If
                    Next
                    '-------------------------------------------------------------------------------------
                ElseIf cont = 7 Then
                    For Each btn As Control In Me.GroupBox2.Controls
                        If TypeOf btn Is Button And btn.Text <> "" Then
                            If CDate(btn.Text & "/" & Combo_mois.Text & "/" & Combo_annee.Text) = CDate(T(i, 0)) Then
                                btn.BackColor = Color.DarkOrange
                            End If
                        End If
                    Next
                    '--------------------------------------------------------------------------------------
                ElseIf cont = 11 Then
                    For Each btn As Control In Me.GroupBox2.Controls
                        If TypeOf btn Is Button And btn.Text <> "" Then
                            If CDate(btn.Text & "/" & Combo_mois.Text & "/" & Combo_annee.Text) = CDate(T(i, 0)) Then
                                btn.BackColor = Color.Blue
                            End If
                        End If
                    Next
                    '--------------------------------------------------------------------------------------
                ElseIf cont = 5 Then
                    For Each btn As Control In Me.GroupBox2.Controls
                        If TypeOf btn Is Button And btn.Text <> "" Then
                            If CDate(btn.Text & "/" & Combo_mois.Text & "/" & Combo_annee.Text) = CDate(T(i, 0)) Then
                                btn.BackColor = Color.Black
                                btn.ForeColor = Color.White
                            End If
                        End If
                    Next
                    '--------------------------------------------------------------------------------------
                ElseIf cont = 9 Then
                    For Each btn As Control In Me.GroupBox2.Controls
                        If TypeOf btn Is Button And btn.Text <> "" Then
                            If CDate(btn.Text & "/" & Combo_mois.Text & "/" & Combo_annee.Text) = CDate(T(i, 0)) Then
                                btn.BackColor = Color.White
                                btn.ForeColor = Color.Black
                            End If
                        End If
                    Next
                    '--------------------------------------------------------------------------------------
                ElseIf cont = 13 Then
                    For Each btn As Control In Me.GroupBox2.Controls
                        If TypeOf btn Is Button And btn.Text <> "" Then
                            If CDate(btn.Text & "/" & Combo_mois.Text & "/" & Combo_annee.Text) = CDate(T(i, 0)) Then
                                btn.BackColor = Color.Gray
                                btn.ForeColor = Color.White
                            End If
                        End If
                    Next
                    '--------------------------------------------------------------------------------------
                ElseIf cont = 10 Then
                    For Each btn As Control In Me.GroupBox2.Controls
                        If TypeOf btn Is Button And btn.Text <> "" Then
                            If CDate(btn.Text & "/" & Combo_mois.Text & "/" & Combo_annee.Text) = CDate(T(i, 0)) Then
                                btn.BackColor = Color.Tan
                                btn.ForeColor = Color.Black
                            End If
                        End If
                    Next
                    '--------------------------------------------------------------------------------------
                ElseIf cont = 14 Then
                    For Each btn As Control In Me.GroupBox2.Controls
                        If TypeOf btn Is Button And btn.Text <> "" Then
                            If CDate(btn.Text & "/" & Combo_mois.Text & "/" & Combo_annee.Text) = CDate(T(i, 0)) Then
                                btn.BackColor = Color.Aquamarine
                                btn.ForeColor = Color.Black
                            End If
                        End If
                    Next
                    '--------------------------------------------------------------------------------------
                ElseIf cont = 18 Then
                    For Each btn As Control In Me.GroupBox2.Controls
                        If TypeOf btn Is Button And btn.Text <> "" Then
                            If CDate(btn.Text & "/" & Combo_mois.Text & "/" & Combo_annee.Text) = CDate(T(i, 0)) Then
                                btn.BackColor = Color.BlueViolet
                                btn.ForeColor = Color.White
                            End If
                        End If
                    Next
                    '--------------------------------------------------------------------------------------
                ElseIf cont = 12 Then
                    For Each btn As Control In Me.GroupBox2.Controls
                        If TypeOf btn Is Button And btn.Text <> "" Then
                            If CDate(btn.Text & "/" & Combo_mois.Text & "/" & Combo_annee.Text) = CDate(T(i, 0)) Then
                                btn.BackColor = Color.Pink
                                btn.ForeColor = Color.Black
                            End If
                        End If
                    Next
                    '--------------------------------------------------------------------------------------
                ElseIf cont = 16 Then
                    For Each btn As Control In Me.GroupBox2.Controls
                        If TypeOf btn Is Button And btn.Text <> "" Then
                            If CDate(btn.Text & "/" & Combo_mois.Text & "/" & Combo_annee.Text) = CDate(T(i, 0)) Then
                                btn.BackColor = Color.LightSteelBlue
                                btn.ForeColor = Color.Black
                            End If
                        End If
                    Next
                    '--------------------------------------------------------------------------------------
                ElseIf cont = 20 Then
                    For Each btn As Control In Me.GroupBox2.Controls
                        If TypeOf btn Is Button And btn.Text <> "" Then
                            If CDate(btn.Text & "/" & Combo_mois.Text & "/" & Combo_annee.Text) = CDate(T(i, 0)) Then
                                btn.BackColor = Color.Fuchsia
                                btn.ForeColor = Color.White
                            End If
                        End If
                    Next
                    '--------------------------------------------------------------------------------------
                ElseIf cont = 21 Then
                    For Each btn As Control In Me.GroupBox2.Controls
                        If TypeOf btn Is Button And btn.Text <> "" Then
                            If CDate(btn.Text & "/" & Combo_mois.Text & "/" & Combo_annee.Text) = CDate(T(i, 0)) Then
                                btn.BackColor = Color.Olive
                                btn.ForeColor = Color.White
                            End If
                        End If
                    Next
                    '--------------------------------------------------------------------------------------
                ElseIf cont = 23 Then
                    For Each btn As Control In Me.GroupBox2.Controls
                        If TypeOf btn Is Button And btn.Text <> "" Then
                            If CDate(btn.Text & "/" & Combo_mois.Text & "/" & Combo_annee.Text) = CDate(T(i, 0)) Then
                                btn.BackColor = Color.PapayaWhip
                                btn.ForeColor = Color.Black
                            End If
                        End If
                    Next
                End If
                '-----------------------------------------------------------------------------------------
                If i < ligne - 1 Then
                    temp = CDate(T(i + 1, 0))
                End If
                cont = 0
            End If
        Next
    End Sub

    Public Sub agenda()
        '--------------------------------------------------------------
        For Each btn As Control In Me.GroupBox2.Controls
            If TypeOf btn Is Button Then
                btn.Text = ""
                btn.Visible = True
                btn.BackColor = Color.Maroon
                btn.ForeColor = Color.White
            End If
        Next
        '--------------------------------------------------------------
        Dim d As Date = "1/" & Combo_mois.Text & "/" & Combo_annee.Text
        Dim nbr As Integer = Weekday(d)
        If nbr = 1 Then
            nbr = 7
        Else
            nbr -= 1
        End If
        For i As Integer = 1 To Date.DaysInMonth(Combo_annee.Text, Combo_mois.Text)
            For Each btn As Control In Me.GroupBox2.Controls
                If TypeOf btn Is Button Then
                    If btn.Name = "btn_" & nbr Then
                        btn.Text = i
                        Exit For
                    End If
                End If
            Next
            nbr += 1
        Next
        '--------------------------------------------------------------
        For Each btn As Control In Me.GroupBox2.Controls
            If TypeOf btn Is Button Then
                If btn.Text = "" Then
                    btn.Visible = False
                End If
            End If
        Next
        '--------------------------------------------------------------
        levents()
        '--------------------------------------------------------------
        colorer()
    End Sub
    Public Sub remplir()
        List_tous.Items.Clear()
        If (Check_lun.Checked = True Or Check_mard.Checked = True Or Check_merc.Checked = True Or Check_jeu.Checked = True Or Check_vend.Checked = True Or Check_sam.Checked = True Or Check_dim.Checked = True) Then

            Try
                Cmd = New SqlCommand("delete from agenda " & _
                                      "Declare @StartDate  Datetime = '" & Format(Date_debut.Value.Date, "MM-dd-yyyy") & "'" & _
                                      "Declare @EndDate    Datetime = '" & Format(Date_fin.Value.Date, "MM-dd-yyyy") & "'" & _
                                      "While @StartDate <= @EndDate " & _
                                      "Begin " & _
                                      "insert into agenda select @StartDate ,DATEPART (dw,@StartDate) " & _
                                      "where DATEPART(dw,@StartDate)in (" & index & ")" & _
                                      "Set @StartDate += 1 " & _
                                      "End", Con)

                open()
                Cmd.ExecuteNonQuery()
                cnClose()
                '------------------------------------------
                Cmd = New SqlCommand("Select agenda.*,Date_evenement,lieu,jour_nuit,Annuler From agenda,Clients_Demande where [date]=Date_evenement", Con)
                open()
                Dr = Cmd.ExecuteReader()
                Dim str As String = ""
                Do While Dr.Read()
                    If Dr("index") = 1 Then
                        str = "Dimanche"
                    ElseIf Dr("index") = 2 Then
                        str = "Lundi"
                    ElseIf Dr("index") = 3 Then
                        str = "Mardi"
                    ElseIf Dr("index") = 4 Then
                        str = "Mercredi"
                    ElseIf Dr("index") = 5 Then
                        str = "Jeudi"
                    ElseIf Dr("index") = 6 Then
                        str = "Vendredi"
                    ElseIf Dr("index") = 7 Then
                        str = "Samedi"
                    End If
                    If Dr("Annuler") = "true" Then
                        Dim Line As ListViewItem = New ListViewItem(New String() {str, Dr("date"), Dr("lieu"), Dr("jour_nuit")})
                        Line.ForeColor = Color.Red
                        List_tous.Items.Add(Line)
                    Else
                        Dim Line As ListViewItem = New ListViewItem(New String() {str, Dr("date"), Dr("lieu"), Dr("jour_nuit")})
                        List_tous.Items.Add(Line)
                    End If

                Loop
                Dr.Close()
                cnClose()
            Catch ex As Exception
                MsgBox(ex.Message, MsgBoxStyle.Exclamation)
                cnClose()
            End Try
        End If
    End Sub

    Public Sub indexof()
        index = ""
        If Check_dim.Checked = True Then
            If index = "" Then
                index = "1"
            Else
                index += ",1"
            End If
        End If
        '-------------------------------------------------
        If Check_lun.Checked = True Then
            If index = "" Then
                index = "2"
            Else
                index += ",2"
            End If
        End If
        '-------------------------------------------------
        If Check_mard.Checked = True Then
            If index = "" Then
                index = "3"
            Else
                index += ",3"
            End If
        End If
        '-------------------------------------------------
        If Check_merc.Checked = True Then
            If index = "" Then
                index = "4"
            Else
                index += ",4"
            End If
        End If
        '-------------------------------------------------
        If Check_jeu.Checked = True Then
            If index = "" Then
                index = "5"
            Else
                index += ",5"
            End If
        End If
        '-------------------------------------------------
        If Check_vend.Checked = True Then
            If index = "" Then
                index = "6"
            Else
                index += ",6"
            End If
        End If
        '-------------------------------------------------
        If Check_sam.Checked = True Then
            If index = "" Then
                index = "7"
            Else
                index += ",7"
            End If
        End If
    End Sub

    Private Sub Frm_Agenda_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        '------------------------------------------------
        For i As Integer = 2000 To 2020
            Combo_annee.Items.Add(i)
        Next
        Combo_annee.SelectedItem = Now.Date.Year
        '------------------------------------------------
        For i As Integer = 1 To 12
            Combo_mois.Items.Add(i)
        Next
        Combo_mois.SelectedItem = Now.Date.Month
        '------------------------------------------------
        loade = False
    End Sub

    Private Sub Check_lun_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Check_lun.CheckedChanged
        indexof()
        remplir()

    End Sub

    Private Sub Check_mard_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Check_mard.CheckedChanged
        indexof()
        remplir()
    End Sub

    Private Sub Check_merc_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Check_merc.CheckedChanged
        indexof()
        remplir()
    End Sub

    Private Sub Check_jeu_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Check_jeu.CheckedChanged
        indexof()
        remplir()
    End Sub

    Private Sub Check_vend_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Check_vend.CheckedChanged
        indexof()
        remplir()
    End Sub

    Private Sub Check_sam_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Check_sam.CheckedChanged
        indexof()
        remplir()
    End Sub

    Private Sub Check_dim_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Check_dim.CheckedChanged
        indexof()
        remplir()
    End Sub

    Private Sub Check_jan_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
        remplir()
    End Sub

    Private Sub Check_fev_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
        remplir()
    End Sub

    Private Sub Check_mars_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
        remplir()
    End Sub

    Private Sub Check_avril_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
        remplir()
    End Sub

    Private Sub Check_mai_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
        remplir()
    End Sub

    Private Sub Check_juin_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
        remplir()
    End Sub

    Private Sub Check_juillet_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
        remplir()
    End Sub

    Private Sub Check_aout_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
        remplir()
    End Sub

    Private Sub Check_septe_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
        remplir()
    End Sub

    Private Sub Check_octob_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
        remplir()
    End Sub

    Private Sub Check_nove_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
        remplir()
    End Sub

    Private Sub Check_decem_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
        remplir()
    End Sub

    Private Sub Date_debut_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Date_debut.ValueChanged
        indexof()
        remplir()
    End Sub

    Private Sub Date_fin_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Date_fin.ValueChanged
        indexof()
        remplir()
    End Sub

    Private Sub Combo_annee_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Combo_annee.SelectedIndexChanged
        If loade = False Then
            agenda()
        End If

    End Sub

    Private Sub Combo_mois_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Combo_mois.SelectedIndexChanged
        agenda()
    End Sub

    Private Sub btn_21_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_21.Click
        If btn_21.BackColor <> Color.Maroon Then
            clicke(btn_21.Text)
        End If
    End Sub

    Private Sub btn_14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_14.Click
        If btn_14.BackColor <> Color.Maroon Then
            clicke(btn_14.Text)
        End If
    End Sub

    Private Sub btn_1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_1.Click
        If btn_1.BackColor <> Color.Maroon Then
            clicke(btn_1.Text)
        End If
    End Sub

    Private Sub btn_2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_2.Click
        If btn_2.BackColor <> Color.Maroon Then
            clicke(btn_2.Text)
        End If
    End Sub

    Private Sub btn_3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_3.Click
        If btn_3.BackColor <> Color.Maroon Then
            clicke(btn_3.Text)
        End If
    End Sub

    Private Sub btn_4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_4.Click
        If btn_4.BackColor <> Color.Maroon Then
            clicke(btn_4.Text)
        End If
    End Sub

    Private Sub btn_5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_5.Click
        If btn_5.BackColor <> Color.Maroon Then
            clicke(btn_5.Text)
        End If
    End Sub

    Private Sub btn_6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_6.Click
        If btn_6.BackColor <> Color.Maroon Then
            clicke(btn_6.Text)
        End If
    End Sub

    Private Sub btn_7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_7.Click
        If btn_7.BackColor <> Color.Maroon Then
            clicke(btn_7.Text)
        End If
    End Sub

    Private Sub btn_8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_8.Click
        If btn_8.BackColor <> Color.Maroon Then
            clicke(btn_8.Text)
        End If
    End Sub

    Private Sub btn_9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_9.Click
        If btn_9.BackColor <> Color.Maroon Then
            clicke(btn_9.Text)
        End If
    End Sub

    Private Sub btn_10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_10.Click
        If btn_10.BackColor <> Color.Maroon Then
            clicke(btn_10.Text)
        End If
    End Sub

    Private Sub btn_11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_11.Click
        If btn_11.BackColor <> Color.Maroon Then
            clicke(btn_11.Text)
        End If
    End Sub

    Private Sub btn_12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_12.Click
        If btn_12.BackColor <> Color.Maroon Then
            clicke(btn_12.Text)
        End If
    End Sub

    Private Sub btn_13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_13.Click
        If btn_13.BackColor <> Color.Maroon Then
            clicke(btn_13.Text)
        End If
    End Sub

    Private Sub btn_15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_15.Click
        If btn_15.BackColor <> Color.Maroon Then
            clicke(btn_15.Text)
        End If
    End Sub

    Private Sub btn_16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_16.Click
        If btn_16.BackColor <> Color.Maroon Then
            clicke(btn_16.Text)
        End If
    End Sub

    Private Sub btn_17_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_17.Click
        If btn_17.BackColor <> Color.Maroon Then
            clicke(btn_17.Text)
        End If
    End Sub

    Private Sub btn_18_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_18.Click
        If btn_18.BackColor <> Color.Maroon Then
            clicke(btn_18.Text)
        End If
    End Sub

    Private Sub btn_19_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_19.Click
        If btn_19.BackColor <> Color.Maroon Then
            clicke(btn_19.Text)
        End If
    End Sub

    Private Sub btn_20_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_20.Click
        If btn_20.BackColor <> Color.Maroon Then
            clicke(btn_20.Text)
        End If
    End Sub

    Private Sub btn_22_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_22.Click
        If btn_22.BackColor <> Color.Maroon Then
            clicke(btn_22.Text)
        End If
    End Sub

    Private Sub btn_23_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_23.Click
        If btn_23.BackColor <> Color.Maroon Then
            clicke(btn_23.Text)
        End If
    End Sub

    Private Sub btn_24_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_24.Click
        If btn_24.BackColor <> Color.Maroon Then
            clicke(btn_24.Text)
        End If
    End Sub

    Private Sub btn_25_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_25.Click
        If btn_25.BackColor <> Color.Maroon Then
            clicke(btn_25.Text)
        End If
    End Sub

    Private Sub btn_26_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_26.Click
        If btn_26.BackColor <> Color.Maroon Then
            clicke(btn_26.Text)
        End If
    End Sub

    Private Sub btn_27_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_27.Click
        If btn_27.BackColor <> Color.Maroon Then
            clicke(btn_27.Text)
        End If
    End Sub

    Private Sub btn_28_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_28.Click
        If btn_28.BackColor <> Color.Maroon Then
            clicke(btn_28.Text)
        End If
    End Sub

    Private Sub btn_29_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_29.Click
        If btn_29.BackColor <> Color.Maroon Then
            clicke(btn_29.Text)
        End If
    End Sub

    Private Sub btn_30_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_30.Click
        If btn_30.BackColor <> Color.Maroon Then
            clicke(btn_30.Text)
        End If
    End Sub

    Private Sub btn_31_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_31.Click
        If btn_31.BackColor <> Color.Maroon Then
            clicke(btn_31.Text)
        End If
    End Sub

    Private Sub btn_32_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_32.Click
        If btn_32.BackColor <> Color.Maroon Then
            clicke(btn_32.Text)
        End If
    End Sub

    Private Sub btn_33_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_33.Click
        If btn_33.BackColor <> Color.Maroon Then
            clicke(btn_33.Text)
        End If
    End Sub

    Private Sub btn_34_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_34.Click
        If btn_34.BackColor <> Color.Maroon Then
            clicke(btn_34.Text)
        End If
    End Sub

    Private Sub btn_35_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_35.Click
        If btn_35.BackColor <> Color.Maroon Then
            clicke(btn_35.Text)
        End If
    End Sub

    Private Sub btn_36_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_36.Click
        If btn_36.BackColor <> Color.Maroon Then
            clicke(btn_36.Text)
        End If
    End Sub

    Private Sub btn_37_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_37.Click
        If btn_37.BackColor <> Color.Maroon Then
            clicke(btn_37.Text)
        End If
    End Sub

    Private Sub btn_38_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_38.Click
        If btn_38.BackColor <> Color.Maroon Then
            clicke(btn_38.Text)
        End If
    End Sub

    Private Sub btn_39_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_39.Click
        If btn_39.BackColor <> Color.Maroon Then
            clicke(btn_39.Text)
        End If
    End Sub

    Private Sub btn_40_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_40.Click
        If btn_40.BackColor <> Color.Maroon Then
            clicke(btn_40.Text)
        End If
    End Sub

    Private Sub btn_41_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_41.Click
        If btn_41.BackColor <> Color.Maroon Then
            clicke(btn_41.Text)
        End If
    End Sub

    Private Sub btn_42_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_42.Click
        If btn_42.BackColor <> Color.Maroon Then
            clicke(btn_42.Text)
        End If
    End Sub
End Class